package com.kdd.campus.sh.service.impl;

import com.kdd.campus.sh.dao.ShKeywordMapper;
import com.kdd.campus.sh.po.ShKeywords;
import com.kdd.campus.sh.service.ShKeywordsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * @Auther: fcp
 * @Date: 2020/3/25 21:12
 * @Description:
 */
@Service
public class ShKeywordsServiceImpl implements ShKeywordsService {
    @Autowired
    private ShKeywordMapper shKeywordMapper;

    @Override
    public List<ShKeywords> findHot() {
        Example example = new Example(ShKeywords.class);
        example.orderBy("sortOrder").asc();
        example.and().andEqualTo("isHot", 1).andEqualTo("isShow", 1);
        example.selectProperties("keyword","url");
        return shKeywordMapper.selectByExample(example);
    }
}
